home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
011
/
arc43.lbr
/
ARCDOS.MQC
/
arcdos.mac
Wrap
Text File
|
1985-10-30
|
3KB
|
66 lines
/* ARC - Archive utility - ARCDOS
$define(tag,$$segment(@1,$$index(@1,=)+1))#
$define(version,Version $tag(
TED_VERSION DB =1.42), created on $tag(
TED_DATE DB =05/01/85) at $tag(
TED_TIME DB =21:07:21))#
$undefine(tag)#
$version
(C) COPYRIGHT 1985 by System Enhancement Associates; ALL RIGHTS RESERVED
By: Thom Henderson
Description:
This file contains certain DOS level routines that assist
in doing fancy things with an archive, primarily reading and
setting the date and time last modified.
These are, by nature, system dependant functions. But they are
also, by nature, very expendable.
Language:
Computer Innovations Optimizing C86
*/
#include <stdio.h>
#include "arc.h"
#include "fileio2.h" /* needed for filehand */
getstamp(f,date,time) /* get a file's date/time stamp */
FILE *f; /* file to get stamp from */
int *date, *time; /* storage for the stamp */
{
struct {int ax,bx,cx,dx,si,di,ds,es;} reg;
reg.ax = 0x5700; /* get date/time */
reg.bx = filehand(f); /* file handle */
if(sysint21(®,®)&1) /* DOS call */
printf("Get timestamp fail (%d)\n",reg.ax);
*date = reg.dx; /* save date/time */
*time = reg.cx;
}
setstamp(f,date,time) /* set a file's date/time stamp */
FILE *f; /* file to set stamp on */
int date, time; /* desired date, time */
{
struct {int ax,bx,cx,dx,si,di,ds,es;} reg;
fflush(f); /* force any pending output */
reg.ax = 0x5701; /* set date/time */
reg.bx = filehand(f); /* file handle */
reg.cx = time; /* desired time */
reg.dx = date; /* desired date */
if(sysint21(®,®)&1) /* DOS call */
printf("Set timestamp fail (%d)\n",reg.ax);
}
int filehand(stream) /* find handle on a file */
struct bufstr *stream; /* file to grab onto */
{
return stream->bufhand; /* return DOS 2.0 file handle */
}